public class Solution371 {
    public int getSum(int a, int b) {
        int sum,carry;
        while (b!=0)
        {
            sum = a^b;
            carry = (a&b) << 1;//产生进位的情况，需要左移，然后再相加
            a = sum;
            b = carry;
        } //进位情况
        return a;
    }

    public static void main(String[] args) {

    }
}
